using Microsoft.AspNetCore.Mvc.Filters;

namespace Geekeradmin.Filters
{
    /// <summary>
    /// ActionFilter/ResourceFilter中只要是对HttpContext.Result赋值，就不再继续往后了。
    /// 如果在ResourceFilter处理后，HttpContext赋值后，也想在后面来一个补充扩展操作
    /// </summary>
    public class CustomAlwaysRunResult : Attribute, IAlwaysRunResultFilter
    {
        public void OnResultExecuting(ResultExecutingContext context)
        {
            Console.WriteLine("CustomAlwaysRunResult.OnResultExecuting");
        }

        public void OnResultExecuted(ResultExecutedContext context)
        {
            Console.WriteLine("CustomAlwaysRunResult.OnResultExecuted");
        }

    }
}
